package com.my12306.user.model.po;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Objects;

/**
 * 点对点聊天消息模型
 *
 * @Author:苏牧夕
 * @Date:2020-05-15 17:36:13
 * @Version 1.0
 */
@TableName("p_message")
public class PMessageEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId
    private Long id;
    /**
     * 发送消息者id
     */
    private Long fromId;
    /**
     * 接收消息者id
     */
    private Long toId;
    /**
     * 消息内容
     */
    private String msgComment;
    /**
     * 消息类型：文字、音频、图片
     */
    private Integer msgType;
    /**
     * 逻辑删除 0-表示删除，1-表示正常
     */
    private Integer logicDelete;
    /**
     * 显示状态 0-表示禁用 1-表示正常
     */
    private Integer showStatus;
    /**
     * 修改时间
     */
    private String updateDate;
    /**
     * 版本号
     */
    private Integer version;

    public PMessageEntity() {
    }

    public PMessageEntity(Long id, Long fromId, Long toId, String msgComment, Integer msgType, Integer logicDelete, Integer showStatus, String updateDate, Integer version) {
        this.id = id;
        this.fromId = fromId;
        this.toId = toId;
        this.msgComment = msgComment;
        this.msgType = msgType;
        this.logicDelete = logicDelete;
        this.showStatus = showStatus;
        this.updateDate = updateDate;
        this.version = version;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Override
    public String toString() {
        return "PMessageEntity{" +
                "id=" + id +
                ", fromId=" + fromId +
                ", toId=" + toId +
                ", msgComment='" + msgComment + '\'' +
                ", msgType=" + msgType +
                ", logicDelete=" + logicDelete +
                ", showStatus=" + showStatus +
                ", updateDate='" + updateDate + '\'' +
                ", version=" + version +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PMessageEntity)) return false;
        PMessageEntity that = (PMessageEntity) o;
        return Objects.equals(getId(), that.getId()) &&
                Objects.equals(getFromId(), that.getFromId()) &&
                Objects.equals(getToId(), that.getToId()) &&
                Objects.equals(getMsgComment(), that.getMsgComment()) &&
                Objects.equals(getMsgType(), that.getMsgType()) &&
                Objects.equals(getLogicDelete(), that.getLogicDelete()) &&
                Objects.equals(getShowStatus(), that.getShowStatus()) &&
                Objects.equals(getUpdateDate(), that.getUpdateDate()) &&
                Objects.equals(getVersion(), that.getVersion());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getFromId(), getToId(), getMsgComment(), getMsgType(), getLogicDelete(), getShowStatus(), getUpdateDate(), getVersion());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getFromId() {
        return fromId;
    }

    public void setFromId(Long fromId) {
        this.fromId = fromId;
    }

    public Long getToId() {
        return toId;
    }

    public void setToId(Long toId) {
        this.toId = toId;
    }

    public String getMsgComment() {
        return msgComment;
    }

    public void setMsgComment(String msgComment) {
        this.msgComment = msgComment;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public Integer getLogicDelete() {
        return logicDelete;
    }

    public void setLogicDelete(Integer logicDelete) {
        this.logicDelete = logicDelete;
    }

    public Integer getShowStatus() {
        return showStatus;
    }

    public void setShowStatus(Integer showStatus) {
        this.showStatus = showStatus;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
